package com.ruoyi.web.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.system.service.ISysDictTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/config")
public class ConfigController {

    @Autowired
    ISysDictTypeService sysDictTypeService;

    /**
     * 获取开关状态
     * @return
     */
    @GetMapping("/getStatus")
    public AjaxResult getStatus(){
        SysDictType dictType = sysDictTypeService.selectDictTypeByType("on_or_off");
        return AjaxResult.success(dictType);
    }
}
